package controllers;

import java.util.HashMap;
import java.util.List;
import models.Health;
import play.mvc.Controller;

public class Healths extends Controller{
	
	 public static void index() {
	        render();
	    }
         
          /**
     * Get expert json.
     */
    public static void json(int page, int pagesize) {
    	
    	List<Health> appraiseTypes = Health.all().fetch(page, pagesize);      	 
    	long total = Health.count();
    	
    	HashMap<String,Object> obj = new HashMap<String,Object>();
    	obj.put("Rows", appraiseTypes);
    	obj.put("Total", total);
    	renderJSON(obj);
    }


    /**
     * Update a dept.
     */
    public static void save(Health health) {       
        health.save();
        renderJSON("");
    }
    
    /**
     * Delete a dept.
     */
    public static void delete(long id) {
        Health.findById(id)._delete();
        renderJSON("");
    }


}
